<template>
  <div class="chronic-container">
    <!-- 第一部分：数字化加持健康管理架构图 -->
    <div class="digital-health-section">
      <h2 class="section-title">数字化加持慢病管理</h2>
      
      <div class="architecture-flow">
        <!-- 上游诊前 -->
        <div class="flow-stage upstream">
          <div class="stage-title">上游诊前</div>
          <div class="stage-content">
            <div class="institution-type">
              <div class="type-label">体检机构</div>
              <div class="company-logos">
                <div class="logo-item">平安全健康体测中</div>
                <div class="logo-item">美年大健康</div>
                <div class="logo-item">Health 100</div>
                <div class="logo-item">iKang 爱康</div>
              </div>
            </div>
            <div class="institution-type">
              <div class="type-label">慢病管理机构</div>
              <div class="company-logos">
                <!-- <div class="logo-item">舆</div> -->
              </div>
            </div>
          </div>
        </div>

        <!-- 连接箭头 -->
        <div class="flow-arrow">
          <i class="el-icon-right"></i>
        </div>

        <!-- 中游问诊 -->
        <div class="flow-stage midstream">
          <div class="stage-title">中游问诊</div>
          <div class="stage-content">
            <div class="ecg-line">
              <div class="capsule-icon">
                <i class="el-icon-medal"></i>
              </div>
              <div class="line-graphic"></div>
              <div class="capsule-icon">
                <i class="el-icon-medal"></i>
              </div>
            </div>
          </div>
        </div>

        <!-- 连接箭头 -->
        <div class="flow-arrow">
          <i class="el-icon-right"></i>
        </div>

        <!-- 下游慢病管理 -->
        <div class="flow-stage downstream">
          <div class="stage-title">下游慢病管理</div>
          <div class="stage-content">
            <div class="management-type">
              <div class="type-label">互联网慢病管理企业</div>
              <div class="company-logos">
                <div class="logo-item">医联</div>
                <div class="logo-item">智云健康</div>
                <div class="logo-item">CloudCARE</div>
                <div class="logo-item">医联</div>
                <div class="logo-item">区庭云</div>
              </div>
            </div>
            <div class="management-type">
              <div class="type-label">线下慢病管理企业</div>
              <div class="company-logos">
                <div class="logo-item">华北制药</div>
                <div class="logo-item">HEXIA</div>
                <div class="logo-item">平安</div>
                <div class="logo-item">医联</div>
                <div class="logo-item">益丰大药房</div>
                <div class="logo-item">DrugMart</div>
                <div class="logo-item">YXT Health</div>
                <div class="logo-item">一心堂</div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="chart-footer">
        <div class="footer-info">制图：张文滨</div>
        <div class="footer-info">数据来源：根据公开资料不完全整理</div>
        <div class="footer-note">注：图中只列出部分企业作为代表，未覆盖全产业</div>
      </div>
    </div>

    <!-- 第二部分：慢病管理系统架构 -->
    <div class="system-architecture-section">
      <h2 class="section-title">慢病管理系统架构</h2>
      
      <div class="system-layout">
        <!-- 互联网医院模块 -->
        <div class="module internet-hospital">
          <div class="module-header">互联网医院</div>
          <div class="module-content">
            <div class="function-grid">
              <div class="function-item">复诊预约</div>
              <div class="function-item">慢病日历</div>
              <div class="function-item">在线咨询</div>
              <div class="function-item">报告查询</div>
              <div class="function-item">线上续方</div>
              <div class="function-item">慢病宣教</div>
              <div class="function-item">在线购药</div>
              <div class="function-item">...</div>
            </div>
          </div>
        </div>

        <!-- 箭头连接 -->
        <div class="system-arrow">
          <i class="el-icon-bottom"></i>
        </div>

        <!-- 慢病管理模块 -->
        <div class="module chronic-management">
          <div class="module-header">慢病管理</div>
          <div class="module-content">
            <div class="sub-modules">
              <!-- 慢病管理系统 -->
              <div class="sub-module">
                <div class="sub-module-title">慢病管理系统</div>
                <div class="sub-module-functions">
                  <div class="function-item">个案管理</div>
                  <div class="function-item">分级管理</div>
                  <div class="function-item">复诊管理</div>
                  <div class="function-item">就医记录</div>
                  <div class="function-item">慢病监测</div>
                  <div class="function-item">慢病随访</div>
                  <div class="function-item">慢病筛查</div>
                </div>
              </div>

              <!-- 慢病随访中心 -->
              <div class="sub-module">
                <div class="sub-module-title">慢病随访中心</div>
                <div class="sub-module-functions">
                  <div class="function-item">随访方案</div>
                  <div class="function-item">分级管理</div>
                  <div class="function-item">并发症筛查</div>
                  <div class="function-item">用药指导</div>
                  <div class="function-item">慢病随访规则</div>
                  <div class="function-item">智能坐席</div>
                  <div class="function-item">效果跟踪</div>
                  <div class="function-item">慢病监测</div>
                  <div class="function-item">干预方案</div>
                </div>
              </div>

              <!-- 健康宣教中心 -->
              <div class="sub-module">
                <div class="sub-module-title">健康宣教中心</div>
                <div class="sub-module-functions">
                  <div class="function-item">公众健康宣教</div>
                  <div class="function-item">宣教规则</div>
                  <div class="function-item">宣教知识库</div>
                  <div class="function-item">宣教任务</div>
                  <div class="function-item">宣教跟踪分析</div>
                  <div class="function-item">随访方案</div>
                  <div class="function-item">随访知识库</div>
                  <div class="function-item">随访方案</div>
                  <div class="function-item">健在平台</div>
                  <div class="function-item">日历视图</div>
                </div>
              </div>

              <!-- 复诊工作台 -->
              <div class="sub-module">
                <div class="sub-module-title">复诊工作台</div>
                <div class="sub-module-functions">
                  <div class="function-item">日历视图</div>
                  <div class="function-item">复诊计划</div>
                  <div class="function-item">清点状态</div>
                  <div class="function-item">患者档案</div>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!-- 箭头连接 -->
        <div class="system-arrow">
          <i class="el-icon-bottom"></i>
        </div>

        <!-- 线下实体医疗机构 -->
        <div class="module offline-institutions">
          <div class="module-header">线下实体医疗机构</div>
          <div class="module-content">
            <div class="institution-list">
              <div class="institution-item">村卫生室</div>
              <div class="institution-item">社区卫生服务中心</div>
              <div class="institution-item">二级医院</div>
              <div class="institution-item">...</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ChronicManagement',
  data() {
    return {
      // 可以添加数据属性
    };
  }
};
</script>

<style lang="less" scoped>
.chronic-container {
  // min-height: 100vh;
  padding: 20px;
  background-color: #f5f7fa;
  box-sizing: border-box;

  .section-title {
    text-align: center;
    color: #1a6be0;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e6e6e6;
  }

  .digital-health-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);

    .architecture-flow {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 20px;

      .flow-stage {
        flex: 1;
        text-align: center;

        .stage-title {
          font-size: 18px;
          font-weight: bold;
          color: #333;
          margin-bottom: 15px;
          padding: 8px;
          background-color: #f0f8ff;
          border-radius: 4px;
        }

        .stage-content {
          .institution-type, .management-type {
            margin-bottom: 15px;

            .type-label {
              font-size: 14px;
              color: #666;
              margin-bottom: 8px;
            }

            .company-logos {
              display: flex;
              flex-wrap: wrap;
              justify-content: center;
              gap: 8px;

              .logo-item {
                padding: 6px 12px;
                background-color: #f0f8ff;
                border-radius: 4px;
                font-size: 12px;
                color: #333;
              }
            }
          }
        }

        &.midstream {
          .ecg-line {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 80px;
            position: relative;

            .capsule-icon {
              width: 30px;
              height: 30px;
              background-color: #1a6be0;
              border-radius: 15px;
              display: flex;
              justify-content: center;
              align-items: center;
              color: #fff;

              i {
                font-size: 16px;
              }
            }

            .line-graphic {
              width: 150px;
              height: 2px;
              background-color: #1a6be0;
              margin: 0 15px;
              position: relative;

              &::before, &::after {
                content: '';
                position: absolute;
                width: 10px;
                height: 10px;
                background-color: #1a6be0;
                border-radius: 50%;
              }

              &::before {
                top: -4px;
                left: 30px;
              }

              &::after {
                bottom: -4px;
                right: 30px;
              }
            }
          }
        }
      }

      .flow-arrow {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 15px;
        color: #1a6be0;
        font-size: 24px;
        height: 100px;
      }
    }

    .chart-footer {
      text-align: center;
      font-size: 12px;
      color: #999;

      .footer-info {
        margin-bottom: 5px;
      }

      .footer-note {
        font-style: italic;
      }
    }
  }

  .system-architecture-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);

    .system-layout {
      display: flex;
      flex-direction: column;
      align-items: center;

      .module {
        width: 100%;
        margin-bottom: 20px;

        .module-header {
          font-size: 18px;
          font-weight: bold;
          color: #fff;
          background-color: #8a2be2; // 紫色
          padding: 10px 15px;
          border-radius: 4px;
          margin-bottom: 15px;
          text-align: center;
        }

        .module-content {
          .function-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 10px;

            .function-item {
              padding: 8px 12px;
              background-color: #f0e6ff;
              border-radius: 4px;
              text-align: center;
              font-size: 14px;
              color: #333;
            }
          }

          .sub-modules {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 20px;

            .sub-module {
              .sub-module-title {
                font-size: 16px;
                font-weight: bold;
                color: #8a2be2;
                margin-bottom: 10px;
                padding-bottom: 5px;
                border-bottom: 1px solid #e6e6e6;
              }

              .sub-module-functions {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
                gap: 8px;

                .function-item {
                  padding: 6px 10px;
                  background-color: #f0e6ff;
                  border-radius: 4px;
                  text-align: center;
                  font-size: 12px;
                  color: #333;
                }
              }
            }
          }

          .institution-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 10px;

            .institution-item {
              padding: 8px 12px;
              background-color: #f0e6ff;
              border-radius: 4px;
              text-align: center;
              font-size: 14px;
              color: #333;
            }
          }
        }
      }

      .system-arrow {
        color: #8a2be2;
        font-size: 20px;
        margin: 10px 0;
      }
    }
  }
}

// 响应式调整
@media (max-width: 768px) {
  .chronic-container {
    padding: 10px;

    .digital-health-section {
      .architecture-flow {
        flex-direction: column;

        .flow-stage {
          margin-bottom: 20px;
        }

        .flow-arrow {
          transform: rotate(90deg);
          height: auto;
          padding: 15px 0;
        }
      }
    }

    .system-architecture-section {
      .system-layout {
        .module {
          .module-content {
            .sub-modules {
              grid-template-columns: 1fr;
            }
          }
        }
      }
    }
  }
}
</style>